*** REPLICATION TOOLKIT ***

* AUTHORS: CIMINELLI DUVAL FURCERI 

* ARTICLE: EMPLOYMENT PROTECTION DEREGULATION AND LABOR SHARES IN ADVANCED ECONOMIES 

* JOURNAL: REVIEW OF ECONOMICS AND STATISTICS

* OUTPUT: FIGURE E9 (ONLINE APPENDIX)

***************************

cd ""

use "DTA files/Dataset", clear

**************** LONG-RUN TRENDS IN LABOR PRODUCTIVITY AND WAGES *******************

rename H_EMP h_emp
collapse (first) country (sum) lab h_emp va (mean) PCPI, by(ifscode year) 
foreach x in lab h_emp va {
replace `x' = . if `x' == 0
}
********** CREATE IDENTIFIERS **********

capture drop id_country
capture drop id_cross_section
egen id_country = group(country)
egen id_cross_section = group(ifscode)

********** SET DATASET AS PANEL **********

xtset id_country year

********* PREPARE ********

* Generate value added per hour
gen v = (va/PCPI)/h_emp
gen lv = log(v)
replace v = 100*(lv-l.lv)

* Gen real wage 
gen w = (lab/PCPI)/h_emp
gen lw = log(w)
replace w = 100*(lw-l.lw)

* Smooth
tssmooth ma v = v, replace window(2 1 2)
tssmooth ma w = w, replace window(2 1 2)

collapse v w, by(year)
label var w "Real wage growth"
label var v "Labor productivity growth"

graph twoway line v w year if year != ., lpattern(solid dash) lwidth(thick thick) graphregion(color(white)) xlab(1970(5)2015) xtitle("") yline(0,lcolor(black))
graph export "Figures/E9.png", replace
